build: Use get_supported_arguments()
authorEmmanuele Bassi <ebassi@gnome.org>
Tue, 20 Feb 2018 13:18:28 +0000 (13:18 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Tue, 20 Feb 2018 13:18:28 +0000 (13:18 +0000)
Instead of checking each flag one by one, use the appropriate method of
the Meson compiler object.

meson.build

index b75a085370722d44a05127c1fa8d1cc1f9d836c3..aa6aaa8d19f17cb2eeaf82d250aa9f7773bcba24 100644 (file)
@@ -262,12 +262,7 @@ else
   test_cflags = []
 endif
 
-common_cflags = []
-foreach cflag: test_cflags
-  if cc.has_argument(cflag)
-    common_cflags += [ cflag ]
-  endif
-endforeach
+common_cflags = cc.get_supported_arguments(test_cflags)
 
 # Symbol visibility
 if get_option('default_library') != 'static'